﻿-- =========================================================================================================
-- Author:		MICHAEL RITACCO
-- Copyright:	2010 MEKHANO GROUP LLC
-- Version:		08/29/2010 1.0
-- =========================================================================================================
CREATE PROCEDURE [flcr].[api_service_device_xref_dml_del]
	 (@SERVICE_DEVICE_XREF_UDT AS [flcr].[SERVICE_DEVICE_XREF_UDT] READONLY)

AS

BEGIN TRY
	BEGIN TRAN;
	
	DELETE	[flcr].[SERVICE_DEVICE_XREF]
	 WHERE	[SERVICE_DEVICE_XREF_ID] IN (SELECT [SERVICE_DEVICE_XREF_ID] FROM @SERVICE_DEVICE_XREF_UDT)

	DELETE	[flcrTM].[SERVICE_DEVICE_XREF]
	 WHERE	[SERVICE_DEVICE_XREF_ID] IN (SELECT [SERVICE_DEVICE_XREF_ID] FROM @SERVICE_DEVICE_XREF_UDT)

	COMMIT TRAN;

END TRY
BEGIN CATCH
	ROLLBACK TRANSACTION;
	EXEC [flcr].[utl_getDBError];
END CATCH
